#ifndef YOOHOO_XMPPCORE_TLSNEGOTIANT_H
#define YOOHOO_XMPPCORE_TLSNEGOTIANT_H

#include "xmppcore/negotiant.h"

namespace yoohoo_xmppcore {

class TlsNegotiant : public Negotiant {
	Q_OBJECT
public:
	TlsNegotiant(Connector* connector, QObject* parent = 0);
	void negotiate();

signals:
	void tlsFailure();

protected slots:
	void connectorReceived(QString xml);
	void connectorTlsReady();

protected:
	StreamFeatures* createStreamFeatures();
	void startTls();

private:
	bool processTlsProceedResponse(QString& xml);

private:
	bool _tlsEstablished;
};

}

#endif
